<?php
/**
 * 用户管理
 */
namespace Admin\Model;
use Admin\Common\Model\CommonModel;
class UserPriceModel extends CommonModel
{

    //定义主表名称
    protected $tableName = 'xfjd_user_price';
    //获取列表
    public function getList($where = array(), $order = array('p.id'=>"DESC"))
    {
        //开始分页信息
        $count = $this
             ->join('as p LEFT JOIN exp_xfjd_user as u ON p.user_id = u.id')
            ->where($where)
            ->count();
        //分页
        $Page = new \Think\Page($count, 10);//实例化分页类 传入总记录数和每页显示的记录数(25)
        $show = $Page->show();  //分页显示输出
        $limit = $Page->firstRow . ',' . $Page->listRows;
        $list = $this
            ->alias('p')->join('left join exp_xfjd_user u on p.user_id = u.id ')
            ->where($where)->order($order)->limit($limit)->field('p.*,u.user_name,u.phone')->select();
        $arr = array('count' => $count, 'list' => $list, 'show' => $show, 'nowPage' => $Page->nowPage, 'totalPages' => $Page->totalPages);
        return $arr;
    }

}